package com.xsh.gls.service.impl;

import com.xsh.gls.mapper.BookingMapper;
import com.xsh.gls.pojo.Booking;
import com.xsh.gls.service.BookingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author shkstart
 * @date 2019/1/24 - 10:12
 */
@Service
public class BookingServieImpl implements BookingService {

    @Autowired
    private BookingMapper bookingMapper;

    @Override
    public Booking selectByPrimaryKey(Integer bookingno) {
        return bookingMapper.selectByPrimaryKey(bookingno);
    }

    @Override
    public boolean insertSelective(Booking booking) {
        boolean flag = false;
        if (bookingMapper.insertSelective(booking)>0){
            flag = true;
        }
        return flag;
    }

    @Override
    public boolean updateByPrimaryKeySelective(Booking booking) {
        boolean flag = false;
        if (bookingMapper.updateByPrimaryKeySelective(booking)>0){
            flag = true;
        }
        return flag;
    }

    @Override
    public boolean deleteByBookingno(Integer bookingno) {
        boolean flag = false;
        if (bookingMapper.deleteByBookingno(bookingno)>0){
            flag = true;
        }
        return flag;
    }
}
